******************************
* Table A6: ITT effects of DFS on cognition and education (without child fixed effects)
* wave uis labeled as "Post"
************************
clear all
set trace off
set more off
use Jehanabad_analytic_sample_cognition
label variable hemoglobin "child hemoglobin level"

global socio_cov_4_vari no_HHmembers years_schooling_father years_schooling_mother asset_index

global school_cov_4_vari total_enrollment class_size student_teacher_ratio

g post=wave
label var post "Post"  /* Post denotes endline survey */
g treat_post=treat*post
label var treat_post "Treat*post"
label var treat "Treat"

*** Panel A, Table A6, (raw regression results)
reg block_design_norm treat_post post treat, vce(cluster school_id)
outreg2 using tableA6.doc, word replace ctitle(Block, design,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, No) ///
title(Table A6: ITT effects of DFS on cognition and education (without child fixed effects)) nonotes ///
addnote("Notes: Estimated coefficients are based on a DD model estimated separately in each column. All outcomes, except school attendance, are" ///
"normalized with reference to the baseline mean in the control group. The sample size for attendance is smaller due to missing and inaccurate attendance" ///
"records for some children. All regressions include child fixed effects and time-variant household & school-level controls reported in Table A5." ///
"Standard errors, clustered at the school level, are reported in parentheses. *, **, *** denote significance at the 10%, 5%, and 1% levels, respectively.")


reg block_design_norm treat_post post treat $socio_cov_4_vari $school_cov_4_vari, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Block, design,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes) 

reg digit_span_forward_norm treat_post post treat, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Digit, span, forward) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, No) 

reg digit_span_forward_norm treat_post post treat $socio_cov_4_vari $school_cov_4_vari, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Digit, span, forward) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes) 

reg digit_span_backward_norm treat_post post treat, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Digit, span, backward) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, No) 

reg digit_span_backward_norm treat_post post treat $socio_cov_4_vari $school_cov_4_vari, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Digit, span, backward) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes) 

reg progressive_matrices_norm treat_post post treat, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Progressive, matrices,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, No) 

reg progressive_matrices_norm treat_post post treat $socio_cov_4_vari $school_cov_4_vari, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Progressive, matrices,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes) 

reg day_and_night_norm treat_post post treat, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Day and, night,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, No) 

reg day_and_night_norm treat_post post treat $socio_cov_4_vari $school_cov_4_vari, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Day and, night,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes) 

reg Cognition_Score_pca treat_post post treat, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Cognitive, index,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, No) 

reg Cognition_Score_pca treat_post post treat $socio_cov_4_vari $school_cov_4_vari, vce(cluster school_id)
outreg2 using tableA6.doc, word append ctitle(Cognitive, index,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes) 


*** Panel B, Table A6, (raw regression results)

reg math_norm treat_post post treat, vce(cluster school_id)
outreg2 using tableA6_panelB.doc, word replace ctitle(Math, test score,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, No) ///
title(Table A6: ITT effects of DFS on cognition and education (without child fixed effects)) nonotes

reg math_norm treat_post post treat $socio_cov_4_vari $school_cov_4_vari, vce(cluster school_id)
outreg2 using tableA6_panelB.doc, word append ctitle(Math, test score,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes)

reg reading_norm treat_post post treat, vce(cluster school_id)
outreg2 using tableA6_panelB.doc, word append ctitle(Reading, test score,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes)

reg reading_norm treat_post post treat $socio_cov_4_vari $school_cov_4_vari, vce(cluster school_id)
outreg2 using tableA6_panelB.doc, word append ctitle(Reading, test score,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes)

reg total_attendance_2 treat_post post treat, vce(cluster school_id)
outreg2 using tableA6_panelB.doc, word append ctitle(Attendance,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes)

reg total_attendance_2 treat_post post treat $socio_cov_4_vari $school_cov_4_vari, vce(cluster school_id)
outreg2 using tableA6_panelB.doc, word append ctitle(Attendance,) dec(3) keep(treat_post post treat) nocons nor2 ///
addtext(Control variables, Yes)



********************************************End of do file *******************

  

